//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_spi(SotoInternal) import SotoCore

extension Support {
    // MARK: Enums

    // MARK: Shapes

    public struct AddAttachmentsToSetRequest: AWSEncodableShape {
        /// One or more attachments to add to the set. You can add up to three attachments per set. The size limit is 5 MB per attachment. In the Attachment object, use the data parameter to specify the contents of the attachment file. In the previous request syntax, the value for data appear as blob, which is represented as a base64-encoded string. The value for fileName is the name of the attachment, such as troubleshoot-screenshot.png.
        public let attachments: [Attachment]
        /// The ID of the attachment set. If an attachmentSetId is not specified, a new attachment set is created, and the ID of the set is returned in the response. If an attachmentSetId is specified, the attachments are added to the specified set, if it exists.
        public let attachmentSetId: String?

        @inlinable
        public init(attachments: [Attachment], attachmentSetId: String? = nil) {
            self.attachments = attachments
            self.attachmentSetId = attachmentSetId
        }

        private enum CodingKeys: String, CodingKey {
            case attachments = "attachments"
            case attachmentSetId = "attachmentSetId"
        }
    }

    public struct AddAttachmentsToSetResponse: AWSDecodableShape {
        /// The ID of the attachment set. If an attachmentSetId was not specified, a new attachment set is created, and the ID of the set is returned in the response. If an attachmentSetId was specified, the attachments are added to the specified set, if it exists.
        public let attachmentSetId: String?
        /// The time and date when the attachment set expires.
        public let expiryTime: String?

        @inlinable
        public init(attachmentSetId: String? = nil, expiryTime: String? = nil) {
            self.attachmentSetId = attachmentSetId
            self.expiryTime = expiryTime
        }

        private enum CodingKeys: String, CodingKey {
            case attachmentSetId = "attachmentSetId"
            case expiryTime = "expiryTime"
        }
    }

    public struct AddCommunicationToCaseRequest: AWSEncodableShape {
        /// The ID of a set of one or more attachments for the communication to add to the case. Create the set by calling AddAttachmentsToSet
        public let attachmentSetId: String?
        /// The support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as shown in this example: case-12345678910-2013-c4c1d2bf33c5cf47
        public let caseId: String?
        /// The email addresses in the CC line of an email to be added to the support case.
        public let ccEmailAddresses: [String]?
        /// The body of an email communication to add to the support case.
        public let communicationBody: String

        @inlinable
        public init(attachmentSetId: String? = nil, caseId: String? = nil, ccEmailAddresses: [String]? = nil, communicationBody: String) {
            self.attachmentSetId = attachmentSetId
            self.caseId = caseId
            self.ccEmailAddresses = ccEmailAddresses
            self.communicationBody = communicationBody
        }

        public func validate(name: String) throws {
            try self.validate(self.ccEmailAddresses, name: "ccEmailAddresses", parent: name, max: 10)
            try self.validate(self.communicationBody, name: "communicationBody", parent: name, max: 8000)
            try self.validate(self.communicationBody, name: "communicationBody", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case attachmentSetId = "attachmentSetId"
            case caseId = "caseId"
            case ccEmailAddresses = "ccEmailAddresses"
            case communicationBody = "communicationBody"
        }
    }

    public struct AddCommunicationToCaseResponse: AWSDecodableShape {
        /// True if AddCommunicationToCase succeeds. Otherwise, returns an error.
        public let result: Bool?

        @inlinable
        public init(result: Bool? = nil) {
            self.result = result
        }

        private enum CodingKeys: String, CodingKey {
            case result = "result"
        }
    }

    public struct Attachment: AWSEncodableShape & AWSDecodableShape {
        /// The content of the attachment file.
        public let data: AWSBase64Data?
        /// The name of the attachment file.
        public let fileName: String?

        @inlinable
        public init(data: AWSBase64Data? = nil, fileName: String? = nil) {
            self.data = data
            self.fileName = fileName
        }

        private enum CodingKeys: String, CodingKey {
            case data = "data"
            case fileName = "fileName"
        }
    }

    public struct AttachmentDetails: AWSDecodableShape {
        /// The ID of the attachment.
        public let attachmentId: String?
        /// The file name of the attachment.
        public let fileName: String?

        @inlinable
        public init(attachmentId: String? = nil, fileName: String? = nil) {
            self.attachmentId = attachmentId
            self.fileName = fileName
        }

        private enum CodingKeys: String, CodingKey {
            case attachmentId = "attachmentId"
            case fileName = "fileName"
        }
    }

    public struct CaseDetails: AWSDecodableShape {
        /// The support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as shown in this example: case-12345678910-2013-c4c1d2bf33c5cf47
        public let caseId: String?
        /// The category of problem for the support case.
        public let categoryCode: String?
        /// The email addresses that receive copies of communication about the case.
        public let ccEmailAddresses: [String]?
        /// The ID displayed for the case in the Amazon Web Services Support Center. This is a numeric string.
        public let displayId: String?
        /// The language in which Amazon Web Services Support handles the case. Amazon Web Services Support
        /// currently supports Chinese (“zh”), English ("en"), Japanese ("ja") and Korean (“ko”). You must specify the ISO 639-1
        /// code for the language parameter if you want support in that language.
        public let language: String?
        /// The five most recent communications between you and Amazon Web Services Support Center, including the IDs of any attachments to the communications. Also includes a nextToken that you can use to retrieve earlier communications.
        public let recentCommunications: RecentCaseCommunications?
        /// The code for the Amazon Web Services service. You can get a list of codes and the corresponding service names by calling DescribeServices.
        public let serviceCode: String?
        /// The code for the severity level returned by the call to DescribeSeverityLevels.
        public let severityCode: String?
        /// The status of the case. Valid values:    all-open     customer-action-completed     opened     pending-customer-action     reopened     resolved     unassigned     work-in-progress
        public let status: String?
        /// The subject line for the case in the Amazon Web Services Support Center.
        public let subject: String?
        /// The email address of the account that submitted the case.
        public let submittedBy: String?
        /// The time that the case was created in the Amazon Web Services Support Center.
        public let timeCreated: String?

        @inlinable
        public init(caseId: String? = nil, categoryCode: String? = nil, ccEmailAddresses: [String]? = nil, displayId: String? = nil, language: String? = nil, recentCommunications: RecentCaseCommunications? = nil, serviceCode: String? = nil, severityCode: String? = nil, status: String? = nil, subject: String? = nil, submittedBy: String? = nil, timeCreated: String? = nil) {
            self.caseId = caseId
            self.categoryCode = categoryCode
            self.ccEmailAddresses = ccEmailAddresses
            self.displayId = displayId
            self.language = language
            self.recentCommunications = recentCommunications
            self.serviceCode = serviceCode
            self.severityCode = severityCode
            self.status = status
            self.subject = subject
            self.submittedBy = submittedBy
            self.timeCreated = timeCreated
        }

        private enum CodingKeys: String, CodingKey {
            case caseId = "caseId"
            case categoryCode = "categoryCode"
            case ccEmailAddresses = "ccEmailAddresses"
            case displayId = "displayId"
            case language = "language"
            case recentCommunications = "recentCommunications"
            case serviceCode = "serviceCode"
            case severityCode = "severityCode"
            case status = "status"
            case subject = "subject"
            case submittedBy = "submittedBy"
            case timeCreated = "timeCreated"
        }
    }

    public struct Category: AWSDecodableShape {
        /// The category code for the support case.
        public let code: String?
        /// The category name for the support case.
        public let name: String?

        @inlinable
        public init(code: String? = nil, name: String? = nil) {
            self.code = code
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case code = "code"
            case name = "name"
        }
    }

    public struct Communication: AWSDecodableShape {
        /// Information about the attachments to the case communication.
        public let attachmentSet: [AttachmentDetails]?
        /// The text of the communication between the customer and Amazon Web Services Support.
        public let body: String?
        /// The support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as shown in this example: case-12345678910-2013-c4c1d2bf33c5cf47
        public let caseId: String?
        /// The identity of the account that submitted, or responded to, the support case. Customer entries include the IAM role as well as the email address (for example, "AdminRole (Role) ). Entries from the Amazon Web Services Support team display "Amazon Web Services," and don't show an email address.
        public let submittedBy: String?
        /// The time the communication was created.
        public let timeCreated: String?

        @inlinable
        public init(attachmentSet: [AttachmentDetails]? = nil, body: String? = nil, caseId: String? = nil, submittedBy: String? = nil, timeCreated: String? = nil) {
            self.attachmentSet = attachmentSet
            self.body = body
            self.caseId = caseId
            self.submittedBy = submittedBy
            self.timeCreated = timeCreated
        }

        private enum CodingKeys: String, CodingKey {
            case attachmentSet = "attachmentSet"
            case body = "body"
            case caseId = "caseId"
            case submittedBy = "submittedBy"
            case timeCreated = "timeCreated"
        }
    }

    public struct CommunicationTypeOptions: AWSDecodableShape {
        ///  A JSON-formatted list containing date and time ranges for periods without support
        public let datesWithoutSupport: [DateInterval]?
        ///  A JSON-formatted list containing time ranges when support is available.
        public let supportedHours: [SupportedHour]?
        ///  A string value indicating the communication type. At the moment the type value can assume one of 3 values at the moment chat, web and call.
        public let type: String?

        @inlinable
        public init(datesWithoutSupport: [DateInterval]? = nil, supportedHours: [SupportedHour]? = nil, type: String? = nil) {
            self.datesWithoutSupport = datesWithoutSupport
            self.supportedHours = supportedHours
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case datesWithoutSupport = "datesWithoutSupport"
            case supportedHours = "supportedHours"
            case type = "type"
        }
    }

    public struct CreateCaseRequest: AWSEncodableShape {
        /// The ID of a set of one or more attachments for the case. Create the set by using the AddAttachmentsToSet operation.
        public let attachmentSetId: String?
        /// The category of problem for the support case. You also use the DescribeServices operation to get the category code for a service. Each Amazon Web Services service defines its own set of category codes.
        public let categoryCode: String?
        /// A list of email addresses that Amazon Web Services Support copies on case correspondence. Amazon Web Services Support identifies the account that creates the case when you specify your Amazon Web Services credentials in an HTTP POST method or use the Amazon Web Services SDKs.
        public let ccEmailAddresses: [String]?
        /// The communication body text that describes the issue. This text appears in the Description field on the Amazon Web Services Support Center Create Case page.
        public let communicationBody: String
        /// The type of issue for the case. You can specify customer-service or technical. If you don't specify a value, the default is technical.
        public let issueType: String?
        /// The language in which Amazon Web Services Support handles the case. Amazon Web Services Support
        /// currently supports Chinese (“zh”), English ("en"), Japanese ("ja") and Korean (“ko”). You must specify the ISO 639-1
        /// code for the language parameter if you want support in that language.
        public let language: String?
        /// The code for the Amazon Web Services service. You can use the DescribeServices operation to get the possible serviceCode values.
        public let serviceCode: String?
        /// A value that indicates the urgency of the case. This value determines the response time according to your service level agreement with Amazon Web Services Support. You can use the DescribeSeverityLevels operation to get the possible values for severityCode.  For more information, see SeverityLevel and Choosing a Severity in the Amazon Web Services Support User Guide.  The availability of severity levels depends on the support plan for the Amazon Web Services account.
        public let severityCode: String?
        /// The title of the support case. The title appears in the Subject field on the Amazon Web Services Support Center Create Case page.
        public let subject: String

        @inlinable
        public init(attachmentSetId: String? = nil, categoryCode: String? = nil, ccEmailAddresses: [String]? = nil, communicationBody: String, issueType: String? = nil, language: String? = nil, serviceCode: String? = nil, severityCode: String? = nil, subject: String) {
            self.attachmentSetId = attachmentSetId
            self.categoryCode = categoryCode
            self.ccEmailAddresses = ccEmailAddresses
            self.communicationBody = communicationBody
            self.issueType = issueType
            self.language = language
            self.serviceCode = serviceCode
            self.severityCode = severityCode
            self.subject = subject
        }

        public func validate(name: String) throws {
            try self.validate(self.ccEmailAddresses, name: "ccEmailAddresses", parent: name, max: 10)
            try self.validate(self.communicationBody, name: "communicationBody", parent: name, max: 8000)
            try self.validate(self.communicationBody, name: "communicationBody", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "^[0-9a-z\\-_]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case attachmentSetId = "attachmentSetId"
            case categoryCode = "categoryCode"
            case ccEmailAddresses = "ccEmailAddresses"
            case communicationBody = "communicationBody"
            case issueType = "issueType"
            case language = "language"
            case serviceCode = "serviceCode"
            case severityCode = "severityCode"
            case subject = "subject"
        }
    }

    public struct CreateCaseResponse: AWSDecodableShape {
        /// The support case ID requested or returned in the call. The case ID is an alphanumeric string in the following format: case-12345678910-2013-c4c1d2bf33c5cf47
        public let caseId: String?

        @inlinable
        public init(caseId: String? = nil) {
            self.caseId = caseId
        }

        private enum CodingKeys: String, CodingKey {
            case caseId = "caseId"
        }
    }

    public struct DateInterval: AWSDecodableShape {
        ///  End Date Time (UTC). RFC 3339 format : 'yyyy-MM-dd'T'HH:mm:ss.SSSZZ'.
        public let endDateTime: String?
        ///  A JSON object containing start and date time (UTC). Date and time format is RFC 3339 : 'yyyy-MM-dd'T'HH:mm:ss.SSSZZ'.
        public let startDateTime: String?

        @inlinable
        public init(endDateTime: String? = nil, startDateTime: String? = nil) {
            self.endDateTime = endDateTime
            self.startDateTime = startDateTime
        }

        private enum CodingKeys: String, CodingKey {
            case endDateTime = "endDateTime"
            case startDateTime = "startDateTime"
        }
    }

    public struct DescribeAttachmentRequest: AWSEncodableShape {
        /// The ID of the attachment to return. Attachment IDs are returned by the DescribeCommunications operation.
        public let attachmentId: String

        @inlinable
        public init(attachmentId: String) {
            self.attachmentId = attachmentId
        }

        private enum CodingKeys: String, CodingKey {
            case attachmentId = "attachmentId"
        }
    }

    public struct DescribeAttachmentResponse: AWSDecodableShape {
        /// This object includes the attachment content and file name. In the previous response syntax, the value for the data parameter appears as blob, which is represented as a base64-encoded string. The value for fileName is the name of the attachment, such as troubleshoot-screenshot.png.
        public let attachment: Attachment?

        @inlinable
        public init(attachment: Attachment? = nil) {
            self.attachment = attachment
        }

        private enum CodingKeys: String, CodingKey {
            case attachment = "attachment"
        }
    }

    public struct DescribeCasesRequest: AWSEncodableShape {
        /// The start date for a filtered date search on support case communications. Case communications are available for 12 months after creation.
        public let afterTime: String?
        /// The end date for a filtered date search on support case communications. Case communications are available for 12 months after creation.
        public let beforeTime: String?
        /// A list of ID numbers of the support cases you want returned. The maximum number of cases is 100.
        public let caseIdList: [String]?
        /// The ID displayed for a case in the Amazon Web Services Support Center user interface.
        public let displayId: String?
        /// Specifies whether to include communications in the DescribeCases response. By default, communications are included.
        public let includeCommunications: Bool?
        /// Specifies whether to include resolved support cases in the DescribeCases response. By default, resolved cases aren't included.
        public let includeResolvedCases: Bool?
        /// The language in which Amazon Web Services Support handles the case. Amazon Web Services Support
        /// currently supports Chinese (“zh”), English ("en"), Japanese ("ja") and Korean (“ko”). You must specify the ISO 639-1
        /// code for the language parameter if you want support in that language.
        public let language: String?
        /// The maximum number of results to return before paginating.
        public let maxResults: Int?
        /// A resumption point for pagination.
        public let nextToken: String?

        @inlinable
        public init(afterTime: String? = nil, beforeTime: String? = nil, caseIdList: [String]? = nil, displayId: String? = nil, includeCommunications: Bool? = nil, includeResolvedCases: Bool? = nil, language: String? = nil, maxResults: Int? = nil, nextToken: String? = nil) {
            self.afterTime = afterTime
            self.beforeTime = beforeTime
            self.caseIdList = caseIdList
            self.displayId = displayId
            self.includeCommunications = includeCommunications
            self.includeResolvedCases = includeResolvedCases
            self.language = language
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.caseIdList, name: "caseIdList", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 10)
        }

        private enum CodingKeys: String, CodingKey {
            case afterTime = "afterTime"
            case beforeTime = "beforeTime"
            case caseIdList = "caseIdList"
            case displayId = "displayId"
            case includeCommunications = "includeCommunications"
            case includeResolvedCases = "includeResolvedCases"
            case language = "language"
            case maxResults = "maxResults"
            case nextToken = "nextToken"
        }
    }

    public struct DescribeCasesResponse: AWSDecodableShape {
        /// The details for the cases that match the request.
        public let cases: [CaseDetails]?
        /// A resumption point for pagination.
        public let nextToken: String?

        @inlinable
        public init(cases: [CaseDetails]? = nil, nextToken: String? = nil) {
            self.cases = cases
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case cases = "cases"
            case nextToken = "nextToken"
        }
    }

    public struct DescribeCommunicationsRequest: AWSEncodableShape {
        /// The start date for a filtered date search on support case communications. Case communications are available for 12 months after creation.
        public let afterTime: String?
        /// The end date for a filtered date search on support case communications. Case communications are available for 12 months after creation.
        public let beforeTime: String?
        /// The support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as shown in this example: case-12345678910-2013-c4c1d2bf33c5cf47
        public let caseId: String
        /// The maximum number of results to return before paginating.
        public let maxResults: Int?
        /// A resumption point for pagination.
        public let nextToken: String?

        @inlinable
        public init(afterTime: String? = nil, beforeTime: String? = nil, caseId: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.afterTime = afterTime
            self.beforeTime = beforeTime
            self.caseId = caseId
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 10)
        }

        private enum CodingKeys: String, CodingKey {
            case afterTime = "afterTime"
            case beforeTime = "beforeTime"
            case caseId = "caseId"
            case maxResults = "maxResults"
            case nextToken = "nextToken"
        }
    }

    public struct DescribeCommunicationsResponse: AWSDecodableShape {
        /// The communications for the case.
        public let communications: [Communication]?
        /// A resumption point for pagination.
        public let nextToken: String?

        @inlinable
        public init(communications: [Communication]? = nil, nextToken: String? = nil) {
            self.communications = communications
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case communications = "communications"
            case nextToken = "nextToken"
        }
    }

    public struct DescribeCreateCaseOptionsRequest: AWSEncodableShape {
        /// The category of problem for the support case. You also use the DescribeServices operation to get the category code for a service. Each Amazon Web Services service defines its own set of category codes.
        public let categoryCode: String
        /// The type of issue for the case. You can specify customer-service or technical. If you don't specify a value, the default is technical.
        public let issueType: String
        /// The language in which Amazon Web Services Support handles the case. Amazon Web Services Support
        /// currently supports Chinese (“zh”), English ("en"), Japanese ("ja") and Korean (“ko”). You must specify the ISO 639-1
        /// code for the language parameter if you want support in that language.
        public let language: String
        /// The code for the Amazon Web Services service. You can use the DescribeServices operation to get the possible serviceCode values.
        public let serviceCode: String

        @inlinable
        public init(categoryCode: String, issueType: String, language: String, serviceCode: String) {
            self.categoryCode = categoryCode
            self.issueType = issueType
            self.language = language
            self.serviceCode = serviceCode
        }

        public func validate(name: String) throws {
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "^[0-9a-z\\-_]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case categoryCode = "categoryCode"
            case issueType = "issueType"
            case language = "language"
            case serviceCode = "serviceCode"
        }
    }

    public struct DescribeCreateCaseOptionsResponse: AWSDecodableShape {
        ///  A JSON-formatted array that contains the available communication type options, along with the available support  timeframes for the given inputs.
        public let communicationTypes: [CommunicationTypeOptions]?
        /// Language availability can be any of the following:    available     best_effort     unavailable
        public let languageAvailability: String?

        @inlinable
        public init(communicationTypes: [CommunicationTypeOptions]? = nil, languageAvailability: String? = nil) {
            self.communicationTypes = communicationTypes
            self.languageAvailability = languageAvailability
        }

        private enum CodingKeys: String, CodingKey {
            case communicationTypes = "communicationTypes"
            case languageAvailability = "languageAvailability"
        }
    }

    public struct DescribeServicesRequest: AWSEncodableShape {
        /// The language in which Amazon Web Services Support handles the case. Amazon Web Services Support
        /// currently supports Chinese (“zh”), English ("en"), Japanese ("ja") and Korean (“ko”). You must specify the ISO 639-1
        /// code for the language parameter if you want support in that language.
        public let language: String?
        /// A JSON-formatted list of service codes available for Amazon Web Services services.
        public let serviceCodeList: [String]?

        @inlinable
        public init(language: String? = nil, serviceCodeList: [String]? = nil) {
            self.language = language
            self.serviceCodeList = serviceCodeList
        }

        public func validate(name: String) throws {
            try self.serviceCodeList?.forEach {
                try validate($0, name: "serviceCodeList[]", parent: name, pattern: "^[0-9a-z\\-_]+$")
            }
            try self.validate(self.serviceCodeList, name: "serviceCodeList", parent: name, max: 100)
        }

        private enum CodingKeys: String, CodingKey {
            case language = "language"
            case serviceCodeList = "serviceCodeList"
        }
    }

    public struct DescribeServicesResponse: AWSDecodableShape {
        /// A JSON-formatted list of Amazon Web Services services.
        public let services: [Service]?

        @inlinable
        public init(services: [Service]? = nil) {
            self.services = services
        }

        private enum CodingKeys: String, CodingKey {
            case services = "services"
        }
    }

    public struct DescribeSeverityLevelsRequest: AWSEncodableShape {
        /// The language in which Amazon Web Services Support handles the case. Amazon Web Services Support
        /// currently supports Chinese (“zh”), English ("en"), Japanese ("ja") and Korean (“ko”). You must specify the ISO 639-1
        /// code for the language parameter if you want support in that language.
        public let language: String?

        @inlinable
        public init(language: String? = nil) {
            self.language = language
        }

        private enum CodingKeys: String, CodingKey {
            case language = "language"
        }
    }

    public struct DescribeSeverityLevelsResponse: AWSDecodableShape {
        /// The available severity levels for the support case. Available severity levels are defined by your service level agreement with Amazon Web Services.
        public let severityLevels: [SeverityLevel]?

        @inlinable
        public init(severityLevels: [SeverityLevel]? = nil) {
            self.severityLevels = severityLevels
        }

        private enum CodingKeys: String, CodingKey {
            case severityLevels = "severityLevels"
        }
    }

    public struct DescribeSupportedLanguagesRequest: AWSEncodableShape {
        /// The category of problem for the support case. You also use the DescribeServices operation to get the category code for a service. Each Amazon Web Services service defines its own set of category codes.
        public let categoryCode: String
        /// The type of issue for the case. You can specify customer-service or technical.
        public let issueType: String
        /// The code for the Amazon Web Services service. You can use the DescribeServices operation to get the possible serviceCode values.
        public let serviceCode: String

        @inlinable
        public init(categoryCode: String, issueType: String, serviceCode: String) {
            self.categoryCode = categoryCode
            self.issueType = issueType
            self.serviceCode = serviceCode
        }

        public func validate(name: String) throws {
            try self.validate(self.categoryCode, name: "categoryCode", parent: name, max: 100)
            try self.validate(self.issueType, name: "issueType", parent: name, max: 22)
            try self.validate(self.issueType, name: "issueType", parent: name, min: 9)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 100)
        }

        private enum CodingKeys: String, CodingKey {
            case categoryCode = "categoryCode"
            case issueType = "issueType"
            case serviceCode = "serviceCode"
        }
    }

    public struct DescribeSupportedLanguagesResponse: AWSDecodableShape {
        ///  A JSON-formatted array that contains the available ISO 639-1 language codes.
        public let supportedLanguages: [SupportedLanguage]?

        @inlinable
        public init(supportedLanguages: [SupportedLanguage]? = nil) {
            self.supportedLanguages = supportedLanguages
        }

        private enum CodingKeys: String, CodingKey {
            case supportedLanguages = "supportedLanguages"
        }
    }

    public struct DescribeTrustedAdvisorCheckRefreshStatusesRequest: AWSEncodableShape {
        /// The IDs of the Trusted Advisor checks to get the status.  If you specify the check ID of a check that is automatically refreshed, you might see an InvalidParameterValue error.
        public let checkIds: [String]

        @inlinable
        public init(checkIds: [String]) {
            self.checkIds = checkIds
        }

        private enum CodingKeys: String, CodingKey {
            case checkIds = "checkIds"
        }
    }

    public struct DescribeTrustedAdvisorCheckRefreshStatusesResponse: AWSDecodableShape {
        /// The refresh status of the specified Trusted Advisor checks.
        public let statuses: [TrustedAdvisorCheckRefreshStatus]

        @inlinable
        public init(statuses: [TrustedAdvisorCheckRefreshStatus]) {
            self.statuses = statuses
        }

        private enum CodingKeys: String, CodingKey {
            case statuses = "statuses"
        }
    }

    public struct DescribeTrustedAdvisorCheckResultRequest: AWSEncodableShape {
        /// The unique identifier for the Trusted Advisor check.
        public let checkId: String
        /// The ISO 639-1 code for the language that you want your check results to appear in. The Amazon Web Services Support API currently supports the following languages for Trusted Advisor:   Chinese, Simplified - zh    Chinese, Traditional - zh_TW    English - en    French - fr    German - de    Indonesian - id    Italian - it    Japanese - ja    Korean - ko    Portuguese, Brazilian - pt_BR    Spanish - es
        public let language: String?

        @inlinable
        public init(checkId: String, language: String? = nil) {
            self.checkId = checkId
            self.language = language
        }

        private enum CodingKeys: String, CodingKey {
            case checkId = "checkId"
            case language = "language"
        }
    }

    public struct DescribeTrustedAdvisorCheckResultResponse: AWSDecodableShape {
        /// The detailed results of the Trusted Advisor check.
        public let result: TrustedAdvisorCheckResult?

        @inlinable
        public init(result: TrustedAdvisorCheckResult? = nil) {
            self.result = result
        }

        private enum CodingKeys: String, CodingKey {
            case result = "result"
        }
    }

    public struct DescribeTrustedAdvisorCheckSummariesRequest: AWSEncodableShape {
        /// The IDs of the Trusted Advisor checks.
        public let checkIds: [String]

        @inlinable
        public init(checkIds: [String]) {
            self.checkIds = checkIds
        }

        private enum CodingKeys: String, CodingKey {
            case checkIds = "checkIds"
        }
    }

    public struct DescribeTrustedAdvisorCheckSummariesResponse: AWSDecodableShape {
        /// The summary information for the requested Trusted Advisor checks.
        public let summaries: [TrustedAdvisorCheckSummary]

        @inlinable
        public init(summaries: [TrustedAdvisorCheckSummary]) {
            self.summaries = summaries
        }

        private enum CodingKeys: String, CodingKey {
            case summaries = "summaries"
        }
    }

    public struct DescribeTrustedAdvisorChecksRequest: AWSEncodableShape {
        /// The ISO 639-1 code for the language that you want your checks to appear in. The Amazon Web Services Support API currently supports the following languages for Trusted Advisor:   Chinese, Simplified - zh    Chinese, Traditional - zh_TW    English - en    French - fr    German - de    Indonesian - id    Italian - it    Japanese - ja    Korean - ko    Portuguese, Brazilian - pt_BR    Spanish - es
        public let language: String

        @inlinable
        public init(language: String) {
            self.language = language
        }

        private enum CodingKeys: String, CodingKey {
            case language = "language"
        }
    }

    public struct DescribeTrustedAdvisorChecksResponse: AWSDecodableShape {
        /// Information about all available Trusted Advisor checks.
        public let checks: [TrustedAdvisorCheckDescription]

        @inlinable
        public init(checks: [TrustedAdvisorCheckDescription]) {
            self.checks = checks
        }

        private enum CodingKeys: String, CodingKey {
            case checks = "checks"
        }
    }

    public struct RecentCaseCommunications: AWSDecodableShape {
        /// The five most recent communications associated with the case.
        public let communications: [Communication]?
        /// A resumption point for pagination.
        public let nextToken: String?

        @inlinable
        public init(communications: [Communication]? = nil, nextToken: String? = nil) {
            self.communications = communications
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case communications = "communications"
            case nextToken = "nextToken"
        }
    }

    public struct RefreshTrustedAdvisorCheckRequest: AWSEncodableShape {
        /// The unique identifier for the Trusted Advisor check to refresh.  Specifying the check ID of a check that is automatically refreshed causes an InvalidParameterValue error.
        public let checkId: String

        @inlinable
        public init(checkId: String) {
            self.checkId = checkId
        }

        private enum CodingKeys: String, CodingKey {
            case checkId = "checkId"
        }
    }

    public struct RefreshTrustedAdvisorCheckResponse: AWSDecodableShape {
        /// The current refresh status for a check, including the amount of time until the check is eligible for refresh.
        public let status: TrustedAdvisorCheckRefreshStatus

        @inlinable
        public init(status: TrustedAdvisorCheckRefreshStatus) {
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case status = "status"
        }
    }

    public struct ResolveCaseRequest: AWSEncodableShape {
        /// The support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as shown in this example: case-12345678910-2013-c4c1d2bf33c5cf47
        public let caseId: String?

        @inlinable
        public init(caseId: String? = nil) {
            self.caseId = caseId
        }

        private enum CodingKeys: String, CodingKey {
            case caseId = "caseId"
        }
    }

    public struct ResolveCaseResponse: AWSDecodableShape {
        /// The status of the case after the ResolveCase request was processed.
        public let finalCaseStatus: String?
        /// The status of the case when the ResolveCase request was sent.
        public let initialCaseStatus: String?

        @inlinable
        public init(finalCaseStatus: String? = nil, initialCaseStatus: String? = nil) {
            self.finalCaseStatus = finalCaseStatus
            self.initialCaseStatus = initialCaseStatus
        }

        private enum CodingKeys: String, CodingKey {
            case finalCaseStatus = "finalCaseStatus"
            case initialCaseStatus = "initialCaseStatus"
        }
    }

    public struct Service: AWSDecodableShape {
        /// A list of categories that describe the type of support issue a case describes. Categories consist of a category name and a category code. Category names and codes are passed to Amazon Web Services Support when you call CreateCase.
        public let categories: [Category]?
        /// The code for an Amazon Web Services service returned by the DescribeServices response. The name element contains the corresponding friendly name.
        public let code: String?
        /// The friendly name for an Amazon Web Services service. The code element contains the corresponding code.
        public let name: String?

        @inlinable
        public init(categories: [Category]? = nil, code: String? = nil, name: String? = nil) {
            self.categories = categories
            self.code = code
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case categories = "categories"
            case code = "code"
            case name = "name"
        }
    }

    public struct SeverityLevel: AWSDecodableShape {
        /// The code for case severity level. Valid values: low | normal | high | urgent | critical
        public let code: String?
        /// The name of the severity level that corresponds to the severity level code.  The values returned by the API are different from the values that appear in the Amazon Web Services Support Center. For example, the API uses the code low, but the name appears as General guidance in Support Center.  The following are the API code names and how they appear in the console:    low - General guidance    normal - System impaired    high - Production system impaired    urgent - Production system down    critical - Business-critical system down    For more information, see Choosing a severity in the Amazon Web Services Support User Guide.
        public let name: String?

        @inlinable
        public init(code: String? = nil, name: String? = nil) {
            self.code = code
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case code = "code"
            case name = "name"
        }
    }

    public struct SupportedHour: AWSDecodableShape {
        ///  End Time. RFC 3339 format 'HH:mm:ss.SSS'.
        public let endTime: String?
        ///  Start Time. RFC 3339 format 'HH:mm:ss.SSS'.
        public let startTime: String?

        @inlinable
        public init(endTime: String? = nil, startTime: String? = nil) {
            self.endTime = endTime
            self.startTime = startTime
        }

        private enum CodingKeys: String, CodingKey {
            case endTime = "endTime"
            case startTime = "startTime"
        }
    }

    public struct SupportedLanguage: AWSDecodableShape {
        ///  2 digit ISO 639-1 code. e.g. en
        public let code: String?
        ///  Language display value e.g. ENGLISH
        public let display: String?
        ///  Full language description e.g. ENGLISH
        public let language: String?

        @inlinable
        public init(code: String? = nil, display: String? = nil, language: String? = nil) {
            self.code = code
            self.display = display
            self.language = language
        }

        private enum CodingKeys: String, CodingKey {
            case code = "code"
            case display = "display"
            case language = "language"
        }
    }

    public struct TrustedAdvisorCategorySpecificSummary: AWSDecodableShape {
        /// The summary information about cost savings for a Trusted Advisor check that is in the Cost Optimizing category.
        public let costOptimizing: TrustedAdvisorCostOptimizingSummary?

        @inlinable
        public init(costOptimizing: TrustedAdvisorCostOptimizingSummary? = nil) {
            self.costOptimizing = costOptimizing
        }

        private enum CodingKeys: String, CodingKey {
            case costOptimizing = "costOptimizing"
        }
    }

    public struct TrustedAdvisorCheckDescription: AWSDecodableShape {
        /// The category of the Trusted Advisor check.
        public let category: String
        /// The description of the Trusted Advisor check, which includes the alert criteria and recommended operations (contains HTML markup).
        public let description: String
        /// The unique identifier for the Trusted Advisor check.
        public let id: String
        /// The column headings for the data returned by the Trusted Advisor check. The order of the headings corresponds to the order of the data in the Metadata element of the TrustedAdvisorResourceDetail for the check. Metadata contains all the data that is shown in the Excel download, even in those cases where the UI shows just summary data.
        public let metadata: [String]
        /// The display name for the Trusted Advisor check.
        public let name: String

        @inlinable
        public init(category: String, description: String, id: String, metadata: [String], name: String) {
            self.category = category
            self.description = description
            self.id = id
            self.metadata = metadata
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case category = "category"
            case description = "description"
            case id = "id"
            case metadata = "metadata"
            case name = "name"
        }
    }

    public struct TrustedAdvisorCheckRefreshStatus: AWSDecodableShape {
        /// The unique identifier for the Trusted Advisor check.
        public let checkId: String
        /// The amount of time, in milliseconds, until the Trusted Advisor check is eligible for refresh.
        public let millisUntilNextRefreshable: Int64
        /// The status of the Trusted Advisor check for which a refresh has been requested:     none - The check is not refreshed or the non-success status exceeds the timeout    enqueued - The check refresh requests has entered the refresh queue    processing - The check refresh request is picked up by the rule processing engine    success - The check is successfully refreshed    abandoned - The check refresh has failed
        public let status: String

        @inlinable
        public init(checkId: String, millisUntilNextRefreshable: Int64, status: String) {
            self.checkId = checkId
            self.millisUntilNextRefreshable = millisUntilNextRefreshable
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case checkId = "checkId"
            case millisUntilNextRefreshable = "millisUntilNextRefreshable"
            case status = "status"
        }
    }

    public struct TrustedAdvisorCheckResult: AWSDecodableShape {
        /// Summary information that relates to the category of the check. Cost Optimizing is the only category that is currently supported.
        public let categorySpecificSummary: TrustedAdvisorCategorySpecificSummary
        /// The unique identifier for the Trusted Advisor check.
        public let checkId: String
        /// The details about each resource listed in the check result.
        public let flaggedResources: [TrustedAdvisorResourceDetail]
        public let resourcesSummary: TrustedAdvisorResourcesSummary
        /// The alert status of the check: "ok" (green), "warning" (yellow), "error" (red), or "not_available".
        public let status: String
        /// The time of the last refresh of the check.
        public let timestamp: String

        @inlinable
        public init(categorySpecificSummary: TrustedAdvisorCategorySpecificSummary, checkId: String, flaggedResources: [TrustedAdvisorResourceDetail], resourcesSummary: TrustedAdvisorResourcesSummary, status: String, timestamp: String) {
            self.categorySpecificSummary = categorySpecificSummary
            self.checkId = checkId
            self.flaggedResources = flaggedResources
            self.resourcesSummary = resourcesSummary
            self.status = status
            self.timestamp = timestamp
        }

        private enum CodingKeys: String, CodingKey {
            case categorySpecificSummary = "categorySpecificSummary"
            case checkId = "checkId"
            case flaggedResources = "flaggedResources"
            case resourcesSummary = "resourcesSummary"
            case status = "status"
            case timestamp = "timestamp"
        }
    }

    public struct TrustedAdvisorCheckSummary: AWSDecodableShape {
        /// Summary information that relates to the category of the check. Cost Optimizing is the only category that is currently supported.
        public let categorySpecificSummary: TrustedAdvisorCategorySpecificSummary
        /// The unique identifier for the Trusted Advisor check.
        public let checkId: String
        /// Specifies whether the Trusted Advisor check has flagged resources.
        public let hasFlaggedResources: Bool?
        public let resourcesSummary: TrustedAdvisorResourcesSummary
        /// The alert status of the check: "ok" (green), "warning" (yellow), "error" (red), or "not_available".
        public let status: String
        /// The time of the last refresh of the check.
        public let timestamp: String

        @inlinable
        public init(categorySpecificSummary: TrustedAdvisorCategorySpecificSummary, checkId: String, hasFlaggedResources: Bool? = nil, resourcesSummary: TrustedAdvisorResourcesSummary, status: String, timestamp: String) {
            self.categorySpecificSummary = categorySpecificSummary
            self.checkId = checkId
            self.hasFlaggedResources = hasFlaggedResources
            self.resourcesSummary = resourcesSummary
            self.status = status
            self.timestamp = timestamp
        }

        private enum CodingKeys: String, CodingKey {
            case categorySpecificSummary = "categorySpecificSummary"
            case checkId = "checkId"
            case hasFlaggedResources = "hasFlaggedResources"
            case resourcesSummary = "resourcesSummary"
            case status = "status"
            case timestamp = "timestamp"
        }
    }

    public struct TrustedAdvisorCostOptimizingSummary: AWSDecodableShape {
        /// The estimated monthly savings that might be realized if the recommended operations are taken.
        public let estimatedMonthlySavings: Double
        /// The estimated percentage of savings that might be realized if the recommended operations are taken.
        public let estimatedPercentMonthlySavings: Double

        @inlinable
        public init(estimatedMonthlySavings: Double, estimatedPercentMonthlySavings: Double) {
            self.estimatedMonthlySavings = estimatedMonthlySavings
            self.estimatedPercentMonthlySavings = estimatedPercentMonthlySavings
        }

        private enum CodingKeys: String, CodingKey {
            case estimatedMonthlySavings = "estimatedMonthlySavings"
            case estimatedPercentMonthlySavings = "estimatedPercentMonthlySavings"
        }
    }

    public struct TrustedAdvisorResourceDetail: AWSDecodableShape {
        /// Specifies whether the Amazon Web Services resource was ignored by Trusted Advisor because it was marked as suppressed by the user.
        public let isSuppressed: Bool?
        /// Additional information about the identified resource. The exact metadata and its order can be obtained by inspecting the TrustedAdvisorCheckDescription object returned by the call to DescribeTrustedAdvisorChecks. Metadata contains all the data that is shown in the Excel download, even in those cases where the UI shows just summary data.
        public let metadata: [String]
        /// The Amazon Web Services Region in which the identified resource is located.
        public let region: String?
        /// The unique identifier for the identified resource.
        public let resourceId: String
        /// The status code for the resource identified in the Trusted Advisor check.
        public let status: String

        @inlinable
        public init(isSuppressed: Bool? = nil, metadata: [String], region: String? = nil, resourceId: String, status: String) {
            self.isSuppressed = isSuppressed
            self.metadata = metadata
            self.region = region
            self.resourceId = resourceId
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case isSuppressed = "isSuppressed"
            case metadata = "metadata"
            case region = "region"
            case resourceId = "resourceId"
            case status = "status"
        }
    }

    public struct TrustedAdvisorResourcesSummary: AWSDecodableShape {
        /// The number of Amazon Web Services resources that were flagged (listed) by the Trusted Advisor check.
        public let resourcesFlagged: Int64
        /// The number of Amazon Web Services resources ignored by Trusted Advisor because information was unavailable.
        public let resourcesIgnored: Int64
        /// The number of Amazon Web Services resources that were analyzed by the Trusted Advisor check.
        public let resourcesProcessed: Int64
        /// The number of Amazon Web Services resources ignored by Trusted Advisor because they were marked as suppressed by the user.
        public let resourcesSuppressed: Int64

        @inlinable
        public init(resourcesFlagged: Int64, resourcesIgnored: Int64, resourcesProcessed: Int64, resourcesSuppressed: Int64) {
            self.resourcesFlagged = resourcesFlagged
            self.resourcesIgnored = resourcesIgnored
            self.resourcesProcessed = resourcesProcessed
            self.resourcesSuppressed = resourcesSuppressed
        }

        private enum CodingKeys: String, CodingKey {
            case resourcesFlagged = "resourcesFlagged"
            case resourcesIgnored = "resourcesIgnored"
            case resourcesProcessed = "resourcesProcessed"
            case resourcesSuppressed = "resourcesSuppressed"
        }
    }
}

// MARK: - Errors

/// Error enum for Support
public struct SupportErrorType: AWSErrorType {
    enum Code: String {
        case attachmentIdNotFound = "AttachmentIdNotFound"
        case attachmentLimitExceeded = "AttachmentLimitExceeded"
        case attachmentSetExpired = "AttachmentSetExpired"
        case attachmentSetIdNotFound = "AttachmentSetIdNotFound"
        case attachmentSetSizeLimitExceeded = "AttachmentSetSizeLimitExceeded"
        case caseCreationLimitExceeded = "CaseCreationLimitExceeded"
        case caseIdNotFound = "CaseIdNotFound"
        case describeAttachmentLimitExceeded = "DescribeAttachmentLimitExceeded"
        case internalServerError = "InternalServerError"
        case throttlingException = "ThrottlingException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize Support
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// An attachment with the specified ID could not be found.
    public static var attachmentIdNotFound: Self { .init(.attachmentIdNotFound) }
    /// The limit for the number of attachment sets created in a short period of time has been exceeded.
    public static var attachmentLimitExceeded: Self { .init(.attachmentLimitExceeded) }
    /// The expiration time of the attachment set has passed. The set expires 1 hour after it is created.
    public static var attachmentSetExpired: Self { .init(.attachmentSetExpired) }
    /// An attachment set with the specified ID could not be found.
    public static var attachmentSetIdNotFound: Self { .init(.attachmentSetIdNotFound) }
    /// A limit for the size of an attachment set has been exceeded. The limits are three attachments and 5 MB per attachment.
    public static var attachmentSetSizeLimitExceeded: Self { .init(.attachmentSetSizeLimitExceeded) }
    /// The case creation limit for the account has been exceeded.
    public static var caseCreationLimitExceeded: Self { .init(.caseCreationLimitExceeded) }
    /// The requested caseId couldn't be located.
    public static var caseIdNotFound: Self { .init(.caseIdNotFound) }
    /// The limit for the number of DescribeAttachment requests in a short period of time has been exceeded.
    public static var describeAttachmentLimitExceeded: Self { .init(.describeAttachmentLimitExceeded) }
    /// An internal server error occurred.
    public static var internalServerError: Self { .init(.internalServerError) }
    ///  You have exceeded the maximum allowed TPS (Transactions Per Second) for the operations.
    public static var throttlingException: Self { .init(.throttlingException) }
}

extension SupportErrorType: Equatable {
    public static func == (lhs: SupportErrorType, rhs: SupportErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension SupportErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
